Conventionally, a PLC (Programmable Logic Controller) for controlling an industrial machine or the like installed in a production line of a factory has been known.
The PLC is provided with a CPU unit for controlling the PLC, an input unit to which a signal from a sensor is inputted, and an output unit for outputting a control signal to an industrial machine or the like. The CPU unit has a memory for storing a user program for controlling the industrial machine or the like. This user program is configured so as to be editable by a tool device connected to the CPU unit.
Moreover, in the PLC, a process for acquiring a signal inputted to the input unit in the memory of the CPU unit, a process for executing the user program, a process for writing execution results (operation results) of the user program in the memory and for sending them to the output unit, and a peripheral process for transmitting and receiving data to and from the tool device are executed repeatedly. Thus, the PLC can control an industrial machine or the like based upon an input from the sensor.
Moreover, conventionally, a PAC (Programmable Automation Controller) provided with a high degree software function of a personal computer and reliability of the PLC has been known (for example, see Patent Document 1 (Japanese Unexamined Patent Publication No. 2009-181443)).
The PAC of the above-mentioned Patent Document 1 (Japanese Unexamined Patent Publication No. 2009-181443) is configured to execute a plurality of tasks in parallel with one another in a time sharing manner, with each task being executed in cycles based on each task. That is, this PAC carries out multitask processes.
In this PAC, it is proposed that an operation mode for executing a user program in each task and a program mode for executing no user program in each task are prepared in a switchable manner.
In this case, the operation mode is a mode for actually controlling an industrial machine or the like by executing a user program, and the program mode is a mode which allows the user to edit a user program by using a tool device, without executing a user program. For this reason, the execution of a user program is stopped by switching modes from the operation mode to the program mode, while the execution of the user program is started by switching modes from the program mode to the operation mode.